package com.jsptpd.smartauth.modules.business.utils;

import java.util.HashMap;
import java.util.Map;

public  class Constants {

    public static String ONE_ROLE_ID = "101";
    public static String TWO_ROLE_ID = "102";
    public static String THREE_ROLE_ID = "103";
    public static String SUPER_ROLE_ID = "104";

    //通用错误码和提示
    public static int COMMON_ERRCODE_SUCC = 0;
    public static int COMMON_ERRCODE_FAIL = -1;
    public static String COMMON_ERRMSG_SUCC = "请求成功";
    public static String COMMON_ERRMSG_FAIL = "请求失败";

    //绑定模式：预约
    public static int WX_BIND_MODE_UNORDER = 0;
    public static int WX_BIND_MODE_ORDER = 1;
    //绑定状态
    public static final int WX_BIND_STATUS_WAIT = 101000;//待绑定
    public static final int WX_BIND_STATUS_DONE = 101001;//已绑定
    public static final int WX_BIND_STATUS_GONE = 101002;//失效
    public static final int WX_BIND_STATUS_FORRBID= 101003;//冻结？
    public static final int WX_BIND_STATUS_OTHER = 101004;//其他？

    //预约类型
    public static final int EMPLOYEE_TYPE_WX = 0;
    public static final int EMPLOYEE_TYPE_EM = 1;

    //cpdat扫码微信登录的错误码
    public static int LOGIN_ERRCODE_SUCC = 0;
    public static int LOGIN_ERRCODE_BIND = -2001;
    public static int LOGIN_ERRCODE_STATE = -2002;
    public static int LOGIN_ERRCODE_TOKEN = -2003;
    public static int LOGIN_ERRCODE_QRCODE = -2004;
    public static int LOGIN_ERRCODE_EXP = -2005;
    public static int LOGIN_ERRCODE_END = -2006;

    public static int LOGIN_ERRCODE_INVALID_PWD = -2007;
    public static int LOGIN_ERRCODE_JWT = -2008;
    public static int LOGIN_ERRCODE_NOUSER = -2009;
    public static int LOGIN_ERRCODE_LOCKED = -2010;
    public static int LOGIN_ERRCODE_LOCKWARN = -2011;

    //微信登录的错误提示，可以在yaml里自行配置
    public static String LOGIN_ERRMSG_SUCC = "登录成功,正在验证";
    public static String LOGIN_ERRMSG_BIND = "尚未绑定!请先在cpdat登录后再进行绑定,然后使用微信登录";
    public static String LOGIN_ERRMSG_STATE = "参数非法";
    public static String LOGIN_ERRMSG_TOKEN = "获取凭证失败,errcode:%s";
    public static String LOGIN_ERRMSG_QRCODE = "扫码错误";
    public static String LOGIN_ERRMSG_EXP = "账号绑定状态异常";
    public static String LOGIN_ERRMSG_END = "账号过期";

    public static String LOGIN_ERRMSG_INVALID_PWD = "用户名或密码错误";
    public static String LOGIN_ERRMSG_JWT = "token过期，请重新登录";
    public static String LOGIN_ERRMSG_NOUSER = "用户不存在";
    public static String LOGIN_ERRMSG_LOCKED = "当前用户被锁定，请于%s后重试";
    public static String LOGIN_ERRMSG_LOCKWARN = "用户名或密码错误，再输错%s次将锁定账号";

    //绑定微信的错误码
    public static int WX_BIND_ERRCODE_SUCC = 0;
    public static int WX_BIND_ERRCODE_UPDATE = -1001;
    public static int WX_BIND_ERRCODE_STATE = -1002;
    public static int WX_BIND_ERRCODE_TOKEN = -1003;
    public static int WX_BIND_ERRCODE_QRCODE = -1004;
    public static int WX_BIND_ERRCODE_DUPL = -1005;
    public static int WX_BIND_ERRCODE_EXP = -1006;
    public static int WX_BIND_ERRCODE_END = -1007;

    //绑定微信的错误提示，可以在yaml里自行配置
    public static String WX_BIND_ERRMSG_SUCC = "绑定成功";
    public static String WX_BIND_ERRMSG_UPDATE = "数据修改失败";
    public static String WX_BIND_ERRMSG_STATE = "参数不合法";
    public static String WX_BIND_ERRMSG_TOKEN = "获取凭证失败,errcode:%s";
    public static String WX_BIND_ERRMSG_QRCODE = "扫码错误";
    public static String WX_BIND_ERRMSG_DUPL = "绑定未成功：该微信或账号已经绑定过";
    public static String WX_BIND_ERRMSG_EXP = "绑定未成功：出现异常";
    public static String WX_BIND_ERRMSG_END = "邀请码已过期,请重新生成";

    //用户密码错误
    public static int USER_ERRCODE_SUCC = 0;
    public static int USER_ERRCODE_INVALID_REQ = 99999;
    public static int USER_ERRCODE_INVALID_PWD = 10000;
    public static int USER_ERRCODE_INVALID_TOKEN = 10001;
    public static int USER_ERRCODE_INVALID_DEVICE = 10002;
    public static int USER_ERRCODE_INVALID_UPDATE = 10003;
    public static int USER_ERRCODE_INVALID_USER = 99998;

    public static String USER_ERRMSG_PWD_SUCC = "密码修改成功";
    public static String USER_ERRMSG_INVALID_REQ = "无效请求";
    public static String USER_ERRMSG_INVALID_PWD_LEN = "密码必须6位及以上";
    public static String USER_ERRMSG_INVALID_PWD_OLD = "原密码不正确";
    public static String USER_ERRMSG_INVALID_PWD_NEW = "密码散列出问题，请联系管理员";
    public static String USER_ERRMSG_INVALID_TOKEN = "无效token";
    public static String USER_ERRMSG_INVALID_UPDATE = "密码修改失败";
    public static String USER_ERRMSG_INVALID_DEVICE = "无效设备号";
    public static String USER_ERRMSG_INVALID_USER = "用户不存在";

    //AUTH名称定义，和客户端保持一致
    public static final String AUTH_HEADTAG_SYSTEM = "system";//8.1
    public static final String AUTH_HEADTAG_BRAND = "brand";//xiaomi
    public static final String AUTH_HEADTAG_VERSION = "version";//1.2.0
    public static final String AUTH_HEADTAG_MODEL = "model";//xiaomi8
    public static final String AUTH_HEADTAG_DEVICE = "deviceId";//IMEI
    public static final String AUTH_HEADTAG_APPID = "appId";
    public static final String AUTH_HEADTAG_APPPACK = "appPack";
    public static final String AUTH_HEADTAG_APPKEY = "appKey";
    public static final String AUTH_HEADTAG_TIME = "reqTime";
    public static final String AUTH_HEADTAG_TOKEN = "Authorization";
    public static final String AUTH_HEADTAG_TOKEN_BEAR = "Bearer ";

    //信息采集模拟信息：deviceId,appId,appVersion,appSystem,appBrand,appModel,token
    public static final String[] COLLECT_SIM_DEFAULT = {"unknown", "","","","","",""};
    public static final String[] COLLECT_SIM_CPDAT = {"cpdat", "jsptpd.cpdat","","browser","","",""};

    //暂时配置

    public static final String AUTH_APPID_SRFA_0 = "jsptpd.srfa.app.android";
    public static final String AUTH_APPPACK_SRFA_0 = "com.jsptpd.srfa";
    public static final String AUTH_APPKEY_SRFA_0 = "gfdPbm9FnYi08vCo";

    public static final String AUTH_APPID_XLCK_0 = "jsptpd.xlck.app.android";
    public static final String AUTH_APPPACK_XLCK_0 = "com.cicdi.xlck";
    public static final String AUTH_APPKEY_XLCK_0 = "35g4dPb959Fy08fv";

    public static final String AUTH_APPID_SRFA = "10910003";
    public static final String AUTH_APPPACK_SRFA  = "com.jsptpd.srfa";
    public static final String AUTH_APPKEY_SRFA  = "HschD6xw";

    public static final String AUTH_APPID_XLCK = "10910002";
    public static final String AUTH_APPPACK_XLCK  = "com.cicdi.xlck";
    public static final String AUTH_APPKEY_XLCK  = "sQTg09G7";

    public static final String AUTH_APPID_CPDAT = "10910001";
    public static final String AUTH_APPPACK_CPDAT  = "jsptpd.cpdat";
    public static final String AUTH_APPKEY_CPDAT  = "SlY7X3w5";

    public static final String AUTH_APPID_VISIT = "10910016";
    public static final String AUTH_APPPACK_VISIT  = "com.cicdi.smart.visit";
    public static final String AUTH_APPKEY_VISIT  = "NRtTkGqn";

    public static final Map APP_GROUP = new HashMap();
    static{
        //老版本
        APP_GROUP.put(AUTH_APPID_SRFA_0,AUTH_APPKEY_SRFA_0);
        APP_GROUP.put(AUTH_APPID_XLCK_0,AUTH_APPKEY_XLCK_0);

        APP_GROUP.put(AUTH_APPID_SRFA,AUTH_APPKEY_SRFA);
        APP_GROUP.put(AUTH_APPID_XLCK,AUTH_APPKEY_XLCK);
        APP_GROUP.put(AUTH_APPID_CPDAT,AUTH_APPKEY_CPDAT);
        APP_GROUP.put(AUTH_APPID_VISIT,AUTH_APPKEY_VISIT);
    }

    public static final String WX_APPID_SRFA = "wx00297ca4cf8cce15";
    public static final String WX_APPKEY_SRFA = "f7d3a09df3bb2b85383721f7eb54d316";

    public static final String WX_APPID_XLCK = "wx5668f8c79117d443";
    public static final String WX_APPKEY_XLCK = "5f7001a6da5eaa17c17959c2f973e31f";

    public static final String WX_APPID_CPDAT = "wx925e87ea0c59525f";
    public static final String WX_APPKEY_CPDAT = "cefb6da7c333585f7dcde7290b486d21";

    public static final Map WX_APP_GROUP = new HashMap();
    static{
        WX_APP_GROUP.put(AUTH_APPID_SRFA,WX_APPID_SRFA+"--"+WX_APPKEY_SRFA);
        WX_APP_GROUP.put(AUTH_APPID_XLCK,WX_APPID_XLCK+"--"+WX_APPKEY_XLCK);
        WX_APP_GROUP.put(AUTH_APPID_CPDAT,WX_APPID_CPDAT+"--"+WX_APPKEY_CPDAT);
    }

    //查询生成推广APP的推荐人Url
    public static final String URL_QUERY_PROP ="http://172.16.11.135:10002/smartDesignTest/api/role/isRelatedRole?userId=%s&roleId=1085826179638046721";
    public static int PROPQR_ERRCODE_SUCC = 0;
    public static int PROPQR_ERRCODE_AUTH = -3001;
    public static String PROPQR_ERRMSG_SUCC = "成功生成二维码";
    public static String PROPQR_ERRMSG_AUTH = "该账号没有推荐人权限，不能生成推荐二维码";

}
